package device

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type ModelRouter struct{}

// InitModelRouter 初始化 model表 路由信息
func (s *ModelRouter) InitModelRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	modelRouter := Router.Group("model").Use(middleware.OperationRecord())
	modelRouterWithoutRecord := Router.Group("model")
	modelRouterWithoutAuth := PublicRouter.Group("model")
	{
		modelRouter.POST("createModel", modelApi.CreateModel)             // 新建model表
		modelRouter.DELETE("deleteModel", modelApi.DeleteModel)           // 删除model表
		modelRouter.DELETE("deleteModelByIds", modelApi.DeleteModelByIds) // 批量删除model表
		modelRouter.PUT("updateModel", modelApi.UpdateModel)              // 更新model表
	}
	{
		modelRouterWithoutRecord.GET("findModel", modelApi.FindModel)       // 根据ID获取model表
		modelRouterWithoutRecord.GET("getModelList", modelApi.GetModelList) // 获取model表列表
	}
	{
		modelRouterWithoutAuth.GET("getModelPublic", modelApi.GetModelPublic) // model表开放接口
	}
}
